<template>
  <div class="echart">
    <div ref="chart" class="chart">
    </div>
  </div>
</template>

<script>
import echarts from 'echarts';

export default {
  name: "Echart",
  props: {
    option: Object
  },
  data() {
    return {

    };
  },
  computed: {

  },
  created() {

  },
  mounted() {
    // this.drawChart();
  },
  watch: {

  },
  methods: {
    drawChart() {
      // 基于准备好的dom，初始化echarts实例
      let myChart = echarts.init(this.$refs.chart);
      // 指定图表的配置项和数据
      let option = this.option;
      // 使用刚指定的配置项和数据显示图表。
      myChart.setOption(option);
    }
  },
  components: {

  },
};
</script>

<style scoped lang="scss">
.echart {
  >.chart {
    height: 450px;
  }
}

</style>
